import { request } from "../../request/index";

Page({
  data: {
    swiperList: [],
    cateList: [],
    floorList: [],
  },
  onLoad: function (options) {
    this.getSwiperList();
    this.getCateList();
    this.getFloorList();
  },
  // 轮播图
  getSwiperList() {
    request({
      url: "/home/swiperdata",
    }).then((res) => {
      this.setData({
        swiperList: res,
      });
    });
  },
  // 导航
  getCateList() {
    request({
      url: "/home/catitems",
    }).then((res) => {
      this.setData({
        cateList: res,
      });
    });
  },
  // 楼层
  getFloorList() {
    request({
      url: "/home/floordata",
    }).then((res) => {
      this.setData({
        floorList: res,
      });
    });
  },
});
